<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>CruiseControl.NET : NCover Reporting Task</title>
	    <link rel="stylesheet" href="styles/site.css" type="text/css" />
        <META http-equiv="Content-Type" content="text/html; charset=UTF-8">	    
    </head>

    <body>
	    <table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
		    <tr>
			    <td valign="top" class="pagebody">
				    <div class="pageheader">
					    <span class="pagetitle">
                            CruiseControl.NET : NCover Reporting Task
                                                    </span>
				    </div>
				    <div class="pagesubheading">
					    This page last changed on Jun 29, 2009 by <font color="#0050B2">csut017</font>.
				    </div>

				    <h3><a name="NCoverReportingTask-NCoverReportingTask"></a>NCover Reporting Task</h3>

<p>Generate a code coverage report using NCover.</p>

<p>NCover is a commerical application that will profile code while unit tests are running. The tool is available from <a href="http://www.ncover.com/">http://www.ncover.com/</a>.</p>

<p><b>Note:</b> CruiseControl.NET currently support NCover 3.0.</p>

<h3><a name="NCoverReportingTask-Version"></a>Version</h3>

<p>This task is available from version 1.5.0.</p>

<h3><a name="NCoverReportingTask-Examples"></a>Examples</h3>

<p>To produce a summary report with a minimum coverage of 95%:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml"><span class="code-tag">&lt;ncoverReport&gt;</span>
  <span class="code-tag">&lt;executable&gt;</span>C:\Program Files\NCover\NCover.Reporting.exe<span class="code-tag">&lt;/executable&gt;</span>
  <span class="code-tag">&lt;outputDir&gt;</span>ncover\reports<span class="code-tag">&lt;/outputDir&gt;</span>
  <span class="code-tag">&lt;reports&gt;</span>
    <span class="code-tag">&lt;report&gt;</span>Summary<span class="code-tag">&lt;/report&gt;</span>
  <span class="code-tag">&lt;/reports&gt;</span>
  <span class="code-tag">&lt;minimumThresholds&gt;</span>
    <span class="code-tag">&lt;coverageThreshold metric=<span class="code-quote">"SymbolCoverage"</span> value=<span class="code-quote">"95"</span>/&gt;</span>
  <span class="code-tag">&lt;/minimumThresholds&gt;</span>
<span class="code-tag">&lt;/ncoverReport&gt;</span></pre>
</div></div>

<p>To generate a full report that is ordered by coverage percentage in a descending order:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml"><span class="code-tag">&lt;ncoverReport&gt;</span>
  <span class="code-tag">&lt;executable&gt;</span>C:\Program Files\NCover\NCover.Reporting.exe<span class="code-tag">&lt;/executable&gt;</span>
  <span class="code-tag">&lt;outputDir&gt;</span>ncover\reports<span class="code-tag">&lt;/outputDir&gt;</span>
  <span class="code-tag">&lt;reports&gt;</span>
    <span class="code-tag">&lt;report&gt;</span>FullCoverageReport<span class="code-tag">&lt;/report&gt;</span>
  <span class="code-tag">&lt;/reports&gt;</span>
  <span class="code-tag">&lt;sortBy&gt;</span>CoveragePercentageDescending<span class="code-tag">&lt;/sortBy&gt;</span>
<span class="code-tag">&lt;/ncoverReport&gt;</span></pre>
</div></div>

<h3><a name="NCoverReportingTask-ConfigurationElements"></a>Configuration Elements</h3>

<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Node </th>
<th class='confluenceTh'> Description </th>
<th class='confluenceTh'> Type </th>
<th class='confluenceTh'> Required </th>
<th class='confluenceTh'> Default </th>
<th class='confluenceTh'> Version </th>
</tr>
<tr>
<td class='confluenceTd'> executable </td>
<td class='confluenceTd'> The executable to use. </td>
<td class='confluenceTd'> String </td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> NCover.Reporting </td>
<td class='confluenceTd'> 1.5.0 </td>
</tr>
<tr>
<td class='confluenceTd'> description </td>
<td class='confluenceTd'> A description of the task. </td>
<td class='confluenceTd'> String </td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> <em>None</em> </td>
<td class='confluenceTd'> 1.5.0 </td>
</tr>
<tr>
<td class='confluenceTd'> timeout </td>
<td class='confluenceTd'> The time-out period in seconds. If the task does no finish running in this time it will be terminated. </td>
<td class='confluenceTd'> Int </td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> 600 </td>
<td class='confluenceTd'> 1.5.0 </td>
</tr>
<tr>
<td class='confluenceTd'> baseDir </td>
<td class='confluenceTd'> The base directory to use. All relative parameters will be relative to this parameter. </td>
<td class='confluenceTd'> String </td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> <em>Working directory for the project</em> </td>
<td class='confluenceTd'> 1.5.0 </td>
</tr>
<tr>
<td class='confluenceTd'> workingDir </td>
<td class='confluenceTd'> The working directory for the executable. If relative, this will be relative to baseDir.<br/>
<b>Maps to //w</b> </td>
<td class='confluenceTd'> String </td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> <em>baseDir</em> </td>
<td class='confluenceTd'> 1.5.0 </td>
</tr>
<tr>
<td class='confluenceTd'> coverageFile </td>
<td class='confluenceTd'> The location to read the coverage date from. </td>
<td class='confluenceTd'> String </td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> Coverage.xml </td>
<td class='confluenceTd'> 1.5.0 </td>
</tr>
<tr>
<td class='confluenceTd'> clearFilters </td>
<td class='confluenceTd'> Should the coverage filters be cleared.<br/>
<b>Maps to //ccf</b> </td>
<td class='confluenceTd'> Boolean </td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> <em>None</em> </td>
<td class='confluenceTd'> 1.5.0 </td>
</tr>
<tr>
<td class='confluenceTd'> filters </td>
<td class='confluenceTd'> The coverage filters to apply.<br/>
<b>Maps to //cf</b> </td>
<td class='confluenceTd'> Array of coverageFilter (see below) </td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> <em>None</em> </td>
<td class='confluenceTd'> 1.5.0 </td>
</tr>
<tr>
<td class='confluenceTd'> minimumThresholds </td>
<td class='confluenceTd'> The minimum coverage thresholds.<br/>
<b>Maps to //mc</b> </td>
<td class='confluenceTd'> Array of coverageThreshold (see below) </td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> <em>None</em> </td>
<td class='confluenceTd'> 1.5.0 </td>
</tr>
<tr>
<td class='confluenceTd'> minimumCoverage </td>
<td class='confluenceTd'> Whether to use minimum coverage or not.<br/>
Maps to //mcsc </td>
<td class='confluenceTd'> Boolean </td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> False </td>
<td class='confluenceTd'> 1.5.0 </td>
</tr>
<tr>
<td class='confluenceTd'> xmlReportFilter </td>
<td class='confluenceTd'> The type of report filtering to use. <br/>
<b>Maps to //rdf</b> </td>
<td class='confluenceTd'> Enum
<ul>
	<li>Default</li>
	<li>Assembly</li>
	<li>Namespace</li>
</ul>
</td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> Default </td>
<td class='confluenceTd'> 1.5.0 </td>
</tr>
<tr>
<td class='confluenceTd'> satisfactory </td>
<td class='confluenceTd'> The satisfactory coverage thresholds.<br/>
<b>Maps to //sct</b> </td>
<td class='confluenceTd'> Array of coverageThreshold (see below) </td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> <em>None</em> </td>
<td class='confluenceTd'> 1.5.0 </td>
</tr>
<tr>
<td class='confluenceTd'> numberToReport </td>
<td class='confluenceTd'> The maximum number of items to report.<br/>
<b>Maps to //sct</b> </td>
<td class='confluenceTd'> Int </td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> -1 </td>
<td class='confluenceTd'> 1.5.0 </td>
</tr>
<tr>
<td class='confluenceTd'> trendOutput </td>
<td class='confluenceTd'> The file to output the trend information to. If relative, this will be relative to baseDir.<br/>
<b>Maps to //at</b> </td>
<td class='confluenceTd'> String </td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> <em>None</em> </td>
<td class='confluenceTd'> 1.5.0 </td>
</tr>
<tr>
<td class='confluenceTd'> trendInput </td>
<td class='confluenceTd'> The file to import the trend information from. If relative, this will be relative to baseDir.<br/>
<b>Maps to //lt</b> </td>
<td class='confluenceTd'> String </td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> <em>None</em> </td>
<td class='confluenceTd'> 1.5.0 </td>
</tr>
<tr>
<td class='confluenceTd'> buildId </td>
<td class='confluenceTd'> A custom build id to attach. <br/>
<b>Maps to //bi</b> </td>
<td class='confluenceTd'> String </td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> <em>The build label</em> </td>
<td class='confluenceTd'> 1.5.0 </td>
</tr>
<tr>
<td class='confluenceTd'> hide </td>
<td class='confluenceTd'> The elements to hide.<br/>
<b>Maps to //hi</b> </td>
<td class='confluenceTd'> String </td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> <em>None</em> </td>
<td class='confluenceTd'> 1.5.0 </td>
</tr>
<tr>
<td class='confluenceTd'> outputDir </td>
<td class='confluenceTd'> The directory to output the reports to. If relative, this will be relative to baseDir. </td>
<td class='confluenceTd'> String </td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> <em>None</em> </td>
<td class='confluenceTd'> 1.5.0 </td>
</tr>
<tr>
<td class='confluenceTd'> reports </td>
<td class='confluenceTd'> The reports to generate.<br/>
*Maps to //or </td>
<td class='confluenceTd'> Array of Enum
<ul>
	<li>FullCoverageReport</li>
	<li>Summary</li>
	<li>UncoveredCodeSections</li>
	<li>SymbolSourceCode</li>
	<li>SymbolSourceCodeClass</li>
	<li>SymbolSourceCodeClassMethod</li>
	<li>MethodSourceCode</li>
	<li>MethodSourceCodeClass</li>
	<li>MethodSourceCodeClassMethod</li>
	<li>SymbolModule</li>
	<li>SymbolModuleNamespace</li>
	<li>SymbolModuleNamespaceClass</li>
	<li>SymbolModuleNamespaceClassMethod</li>
	<li>SymbolCCModuleClassFailedCoverageTop</li>
	<li>SymbolCCModuleClassCoverageTop</li>
	<li>MethodModuleNamespaceClass</li>
	<li>MethodModuleNamespaceClassMethod</li>
	<li>MethodCCModuleClassFailedCoverageTop</li>
	<li>MethodCCModuleClassCoverageTop</li>
</ul>
</td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> FullCoverageReport </td>
<td class='confluenceTd'> 1.5.0 </td>
</tr>
<tr>
<td class='confluenceTd'> projectName </td>
<td class='confluenceTd'> The project name to use in the reports.<br/>
<b>Maps to //p</b> </td>
<td class='confluenceTd'> String </td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> <em>None</em> </td>
<td class='confluenceTd'> 1.5.0 </td>
</tr>
<tr>
<td class='confluenceTd'> sortBy </td>
<td class='confluenceTd'> The sort order to use.<br/>
<b>Maps to //so</b> </td>
<td class='confluenceTd'> Enum
<ul>
	<li>None</li>
	<li>Name</li>
	<li>ClassLine</li>
	<li>CoveragePercentageAscending</li>
	<li>CoveragePercentageDescending</li>
	<li>UnvisitedSequencePointsAscending</li>
	<li>UnvisitedSequencePointsDescending</li>
	<li>VisitCountAscending</li>
	<li>VisitCountDescending</li>
	<li>FunctionCoverageAscending</li>
	<li>FunctionCoverageDescending</li>
</ul>
</td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> None </td>
<td class='confluenceTd'> 1.5.0 </td>
</tr>
<tr>
<td class='confluenceTd'> uncoveredAmount </td>
<td class='confluenceTd'> The amount of uncovered items to report on.<br/>
<b>Maps to //tu</b> </td>
<td class='confluenceTd'> Int </td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> <em>None</em> </td>
<td class='confluenceTd'> 1.5.0 </td>
</tr>
<tr>
<td class='confluenceTd'> mergeMode </td>
<td class='confluenceTd'> The merge mode to use.<br/>
<b>Maps to //mfm</b> </td>
<td class='confluenceTd'> Enum
<ul>
	<li>Default</li>
	<li>KeepSourceFilters</li>
	<li>Destructive</li>
	<li>AppendFilters</li>
</ul>
</td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> Default </td>
<td class='confluenceTd'> 1.5.0 </td>
</tr>
<tr>
<td class='confluenceTd'> mergeFile </td>
<td class='confluenceTd'> The file to store the merged data in. If relative, this will be relative to baseDir. <br/>
<b>Maps to //s</b> </td>
<td class='confluenceTd'> String </td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> <em>None</em> </td>
<td class='confluenceTd'> 1.5.0 </td>
</tr>
</tbody></table>

<h4><a name="NCoverReportingTask-Notes"></a>Notes</h4>

<p>This task requires a profile to be completed before running. See the <a href="NCover Profiler Task.html" title="NCover Profiler Task">NCover Profiler Task</a>.</p>

<p>This task calls NCover.Reporting to generate the reports. Full details on this tool is available at <a href="http://docs.ncover.com/ref/3-0/ncover-reporting/">http://docs.ncover.com/ref/3-0/ncover-reporting/</a>. Additional details on the mapped arguments can be found there.</p>

<h4><a name="NCoverReportingTask-Subelements"></a>Sub-elements</h4>

<h5><a name="NCoverReportingTask-coverageFilter"></a>coverageFilter</h5>

<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Name </th>
<th class='confluenceTh'> Description </th>
<th class='confluenceTh'> Type </th>
<th class='confluenceTh'> Required </th>
<th class='confluenceTh'> Default </th>
<th class='confluenceTh'> Version </th>
</tr>
<tr>
<td class='confluenceTd'> data </td>
<td class='confluenceTd'> The pattern to use for matching items. </td>
<td class='confluenceTd'> String </td>
<td class='confluenceTd'> Yes </td>
<td class='confluenceTd'> <em>n/a</em> </td>
<td class='confluenceTd'> 1.5.0 </td>
</tr>
<tr>
<td class='confluenceTd'> type </td>
<td class='confluenceTd'> The type of item. </td>
<td class='confluenceTd'> Enum 
<ul>
	<li>Default</li>
	<li>Assembly</li>
	<li>Namespace</li>
	<li>Class</li>
	<li>Method</li>
	<li>Document</li>
</ul>
</td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> Default </td>
<td class='confluenceTd'> 1.5.0 </td>
</tr>
<tr>
<td class='confluenceTd'> regex </td>
<td class='confluenceTd'> Whether this is a regex or not. </td>
<td class='confluenceTd'> Boolean </td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> False </td>
<td class='confluenceTd'> 1.5.0 </td>
</tr>
<tr>
<td class='confluenceTd'> include </td>
<td class='confluenceTd'> Whether to include items or not. </td>
<td class='confluenceTd'> Boolean </td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> False </td>
<td class='confluenceTd'> 1.5.0 </td>
</tr>
</tbody></table>

<h5><a name="NCoverReportingTask-coverageThreshold"></a>coverageThreshold</h5>

<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Name </th>
<th class='confluenceTh'> Description </th>
<th class='confluenceTh'> Type </th>
<th class='confluenceTh'> Required </th>
<th class='confluenceTh'> Default </th>
<th class='confluenceTh'> Version </th>
</tr>
<tr>
<td class='confluenceTd'> metric </td>
<td class='confluenceTd'> The coverage metric. </td>
<td class='confluenceTd'> Enum 
<ul>
	<li>SymbolCoverage</li>
	<li>BranchCoverage</li>
	<li>MethodCoverage</li>
	<li>CyclomaticComplexity</li>
</ul>
</td>
<td class='confluenceTd'> Yes </td>
<td class='confluenceTd'> <em>n/a</em> </td>
<td class='confluenceTd'> 1.5.0 </td>
</tr>
<tr>
<td class='confluenceTd'> value </td>
<td class='confluenceTd'> The minimum coverage value </td>
<td class='confluenceTd'> Int </td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> <em>None</em> </td>
<td class='confluenceTd'> 1.5.0 </td>
</tr>
<tr>
<td class='confluenceTd'> type </td>
<td class='confluenceTd'> The type of item. </td>
<td class='confluenceTd'> Enum 
<ul>
	<li>Default</li>
	<li>View</li>
	<li>Module</li>
	<li>Namespace</li>
	<li>Class</li>
</ul>
</td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> <em>None</em> </td>
<td class='confluenceTd'> 1.5.0 </td>
</tr>
<tr>
<td class='confluenceTd'> pattern </td>
<td class='confluenceTd'> The matching pattern to use. </td>
<td class='confluenceTd'> String </td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> <em>None</em> </td>
<td class='confluenceTd'> 1.5.0 </td>
</tr>
</tbody></table>

				    
                    			    </td>
		    </tr>
	    </table>
	    <table border="0" cellpadding="0" cellspacing="0" width="100%">
			<tr>
				<td height="12" background="http://confluence.public.thoughtworks.org//images/border/border_bottom.gif"><img src="images/border/spacer.gif" width="1" height="1" border="0"/></td>
			</tr>
		    <tr>
			    <td align="center"><font color="grey">Document generated by Confluence on Sep 29, 2009 20:59</font></td>
		    </tr>
	    </table>
    </body>
</html>